#!/usr/bin/env python
# encoding: utf-8
# Date: 2017-06-19 09:04:25
# file:models.py
# Email: wang521kang@outlook.com
# Author: 王康
from django.conf import settings
from django.db import models

from commodity.models import Commodity


class ShoppingCart(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL)
    commodity = models.ForeignKey(Commodity, verbose_name=u'商品主键')
    num = models.IntegerField(default=0, verbose_name=u'购买数量')
    is_active = models.BooleanField(default=True, verbose_name=u'是否删除')

    # property = models.CharField(max_length=255, verbose_name=u'商品属性')
    # pro_value = models.CharField(max_length=255, verbose_name=u'商品属性值')
    class Meta:
        unique_together = (('user', 'commodity'),)
